package practice.iterator;

import java.util.Iterator;

/**
 * @ClassName ComputerCollege
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/9/14 18:52
 * @Version 1.0
 */
public class ComputerCollege implements College {
    Department[] departments;
    int num = 0;

    public ComputerCollege() {
        Department[] departments = new Department[5];

        addDepartment("java专业", "java专业");
        addDepartment("Python专业", "Python专业");
        addDepartment("区块链专业", "区块链专业");
    }

    @Override
    public String getCollegeName() {
        return "计算机学院";
    }


    @Override
    public void addDepartment(String name, String desc) {
        Department department = new Department(name, desc);
        departments[num] = department;
        num++;
    }

    @Override
    public Iterator createIterator() {
        return new ComputerCollegeIterator();
    }
}
